package com.googlecode.mgwt.examples.showcase.shared;

import com.googlecode.mgwt.examples.showcase.server.jdo.ServiceCall;

public class ServiceCallTranslator {

	public static ServiceCallDTO entity2dto(ServiceCall call){
		ServiceCallDTO dto = new ServiceCallDTO();
		dto.setComment(call.getComment());
		dto.setDescription(call.getDescription());
		dto.setDate(call.getDate());
		dto.setAddressID(call.getAddressID());
		dto.setFloorID(call.getFloorID());
		dto.setKey(call.getKey().getId());
		dto.setTypeID(call.getTypeID());
		dto.setBuildingID(call.getBuildingID());
		dto.setReporter(call.getReporter());
		dto.setReporterContact(call.getReporterContact());
		return dto;
	}
	public static ServiceCall dto2entity(ServiceCallDTO dto){
		ServiceCall call = new ServiceCall();
		call.setAddressID(dto.getAddressID());
		call.setComment(dto.getComment());
		call.setDescription(dto.getDescription());
		call.setDate(dto.getDate());
		call.setFloorID(dto.getFloorID());
		call.setTypeID(dto.getTypeID());
		call.setBuildingID(dto.getBuildingID());
		call.setReporter(dto.getReporter());
		call.setReporterContact(dto.getReporterContact());
		return call;
	}
}
